<?php include $this->tpl('public:common.php') ?>
<script type="text/javascript" src="<?=site_url()?>/assets/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="<?=site_url()?>/assets/js/ueditor/ueditor.all.min.js"></script>
<div class="well">
    <ul class="nav nav-tabs">
      <li class="active"><a href="#home" data-toggle="tab"><?=get('tpl_id') ? '编辑' : '添加'?>邮件模板</a></li>
    </ul>	
	
	<div id="myTabContent" class="tab-content">
		  <div class="tab-pane active in" id="home">
           <form id="tab" method="post" action="">
				<label>模板名称</label>
				<input type="text" name="name" value="<?=post('name','','strip_tags,trim')?>" class="input-xlarge" required="true"<?=post('name') ? ' disabled="true"' : 'autofocus="true"'?>>
				<label>模板内容&nbsp;&nbsp;<span style="color:#777777;">用{$变量名}代替变量</span></label>
				<div>
					<textarea name="content" style="width:850px;height:500px;" id="tpl_content" class="input-xlarge"><?=post('content','','htmlspecialchars_decode')?></textarea>
				</div>
				<div class="btn-toolbar">
					<button type="submit" class="btn btn-primary"><strong>提交</strong></button>
				</div>
			</form>
        </div>
    </div>
</div>
<script type="text/javascript">
	var ue = UE.getEditor('tpl_content');
</script>
<?php include $this->tpl('public:footer.php') ?>